package com.yiku.controller;

import com.yiku.common.APIResultDTO;
import com.yiku.common.enums.CommonMessageEnum;
import com.yiku.entity.ReceivementDTO;
import com.yiku.service.dingding.DingdingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author:ludada
 * @Date:2024/12/11 15:49
 */
@RestController
@Api(tags = "钉钉")
public class DingController extends BaseController{
    @Autowired
    DingdingService dingService;
    /**
     * 发起钉钉审批
     */
    @ApiOperation("发起钉钉质检")
    @PostMapping("receivementSubmit")
    public String receivementSubmit(@RequestBody ReceivementDTO req, HttpServletResponse response){
        APIResultDTO<String> result = dingService.receivementSubmit(req);
        if(result.isFlag()){
           return "";

        }else{
          return result.getData();

        }
    }
    @ApiOperation("更新钉钉userid到U9C::废弃")
    @GetMapping("updateDingUserIdToU9c")
    public void updateDingUserIdToU9c( HttpServletResponse response){
         dingService.updateDingUserIdToU9c();

    }

}
